package com.yang.webapi.module.service.impl;

import com.yang.security.utils.UserUtils;
import com.yang.service.api.ScarService;
import com.yang.service.model.dto.post.ScarPostDTO;
import com.yang.service.model.vo.ScarVO;
import com.yang.webapi.module.service.ScarWebService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by xin7k
 * Date: 2019/12/4 0004
 */
@Slf4j
@Service
public class ScarWebServiceImpl implements ScarWebService {

    @Autowired
    private ScarService scarService;


    @Override
    public List<ScarVO> getAllScar() {
        String userId = UserUtils.getUserId();
        return scarService.getAllScar(userId);
    }

    @Override
    public boolean addScar(String productId) {
        ScarPostDTO scarPostDTO = new ScarPostDTO();
        scarPostDTO.setProductId(productId);
        scarPostDTO.setUserId(UserUtils.getUserId());
        return scarService.addScar(scarPostDTO);
    }

    @Override
    public boolean deleteBatch(List<String> oderIds) {
        return scarService.deleteBatch(oderIds);
    }
}
